<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>机构端</title>
        <script src="/Public/static/jquery-2.0.3.min.js"></script>
        <script src="/Public/static/layer/layer.js"></script>
        <link rel="stylesheet" href="__PUBLIC__/Home/css/reset.css">
        <link rel="stylesheet" href="__PUBLIC__/Home/css/style.css">
        <link rel="stylesheet" href="__PUBLIC__/Home/css/page.css" />
	</head>

	<body class="agency_box contentBox pos_rel dpflxr">
		<include file="head" />

		<!-- 2.垂直导航 -->
		<div class="navColumn">
			<a href="{:U('Mechanism/floor_index')}" class="navColumnItem actived dpflxr pos_rel" data-type='1'>
				<div class="lineColumn pos_abs"></div>
				<label for="">楼盘管理</label>
				<div class="rightArrow">
				</div>
			</a>
			<a href="{:U('Mechanism/house_type')}" class="navColumnItem  dpflxr pos_rel" data-type='2'>
				<div class="lineColumn pos_abs"></div>
				<label for="">户型管理</label>
				<div class="rightArrow">
				</div>
			</a>
			<a href="{:U('Mechanism/build_manage')}" class="navColumnItem  dpflxr pos_rel" data-type='3'>
				<div class="lineColumn pos_abs"></div>
				<label for="">楼栋管理</label>
				<div class="rightArrow">
				</div>
			</a>
			<a href="{:U('Mechanism/souse_res')}" class="navColumnItem  dpflxr pos_rel" data-type='4'>
				<div class="lineColumn pos_abs"></div>
				<label for="">房源管理</label>
				<div class="rightArrow">
				</div>
			</a>
			
		</div>



		<!-- 二 3.1 楼盘管理  -->
		<div class="contentArea tabPage actived">
			<!-- 3.1.2 新增楼盘 -->
			<div class="addProject">
				<div class="caTitleBox dpflxr">
					<label for="" class="caTitle">新增楼盘</label>
				</div>
				
				<div class="dpflxrjb">
					<div class="switchTab dpflxr" style="width: 410px;">
						<div class="switchItem  dpflxc actived">
							<label for="">基本信息</label>
							<div class="tabLine"></div>
						</div>
						<div class="switchItem dpflxc">
							<label for="">户型管理</label>
							<div class="tabLine"></div>
						</div>
						<div class="switchItem dpflxc">
							<label for="">沙盘展示</label>
							<div class="tabLine"></div>
						</div>
						<div class="switchItem dpflxc">
							<label for="">周围配套</label>
							<div class="tabLine"></div>
						</div>
<!-- 						<div class="switchItem dpflxc">
							<label for="">活动关联</label>
							<div class="tabLine"></div>
						</div> -->
					</div>
					<!-- <div class="stConfirm"><label>确认新增</label></div> -->
				</div>
				
				<!-- 3.1.2.1 基本信息-->

				<div class="switchPage tabPageF actived card dpflxr">
					
					<div class="contentItem  dpflxr ">
						<label for="" class="title">楼盘名称：</label>
						<div class="pos_rel">
							<input type="text" class="inputBox" name="name" value="{$info['name']}" placeholder="请输入楼盘名称" style="padding-right: 56px;"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;"/>
							<label class="pos_abs unit">0/10</label>
						</div>
						
					</div>
					<div class="contentItem  dpflxr">
						<label for="" class="title">状态：</label>
						
						<select name="status" id="status" class="selectBox">
							<option value="1" <if condition="$info['status'] eq 1">selected</if>>待售</option>
							<option value="2" <if condition="$info['status'] eq 2">selected</if>>在售</option>
							<option value="3" <if condition="$info['status'] eq 3">selected</if>>售罄</option>
						</select>
					</div>
					<div class="contentItem  dpflxr ">
						<label for="" class="title">均价：</label>
						<div class="pos_rel">
							<input type="text" class="inputBox" name="price" value="{$info['price']}" placeholder="请输入" style="padding-right: 56px;"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;"/>
							<label class="pos_abs unit">元/m²</label>
						</div>
						
					</div>
<!-- 					<div class="contentItem  dpflxr">
						<label for="" class="title">楼盘地址：</label>
						
						<select name="" id="" class="selectBox">
							<option value="">湖南省-长沙市-岳麓区</option>
							<option value="">湖南省-长沙市-岳麓区</option>
						</select>
					</div> -->
<!-- 					<div class="contentItem  dpflxr">
						<label for="" class="title">详细地址：</label>
						<input type="text" class="inputBox" placeholder="请输入详细地址"
							placeholder-style="font-size:16px;line-height:48px;color:#bfa;" />
					</div> -->
					<div class="contentItem  dpflxr">
						<label for="" class="title">联系热线：</label>
						<input type="text" class="inputBox" name="hot_line" value="{$info['hot_line']}" placeholder="请输入联系热线"
							placeholder-style="font-size:16px;line-height:48px;color:#bfa;" />
					</div>
					<div class="contentItem  dpflxr pos_rel range">
						<label for="" class="title">面积：</label>
						<div class="pos_rel">
							<input type="number" class="inputBox"  name="min_area" value="{$info['min_area']}" placeholder="最小面积" style="padding-right: 56px;"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;"/>
							<label class="pos_abs unit">m²</label>
						</div>
						<label class="line">-</label>
						<div class="pos_rel">
							<input type="number" class="inputBox" name="max_area" value="{$info['max_area']}" placeholder="最大面积" style="padding-right: 56px;"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;"/>
							<label class="pos_abs unit">m²</label>
						</div>
					</div>
					<div class="contentItem checkBox2 dpflxrw">
							<label for="" class="title">卖点：</label>
							<div class="checkBoxArea  dpflxr">
									
								
								<div class="checkBoxItem dpflxrw">
									<input type="checkbox" name="selling_point[]" value="绿化率高" <if condition="$a neq ''">checked</if>>
									<label>绿化率高</label>
								</div>
								<div class="checkBoxItem dpflxr">
									<input type="checkbox" name="selling_point[]" value="车位充足" <if condition="$b neq ''">checked</if>>
									<label>车位充足</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="selling_point[]" value="现房" <if condition="$c neq ''">checked</if>>
									<label>现房</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="selling_point[]" value="学区房" <if condition="$d neq ''">checked</if>>
									<label>学区房</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="selling_point[]" value="近地铁" <if condition="$e neq ''">checked</if>>
									<label>近地铁</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="selling_point[]" value="花园洋房" <if condition="$f neq ''">checked</if>>
									<label>花园洋房</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="selling_point[]" value="小户型" <if condition="$g neq ''">checked</if>>
									<label>小户型</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="selling_point[]" value="低密度" <if condition="$h neq ''">checked</if>>
									<label>低密度</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="selling_point[]"value="复式" <if condition="$i neq ''">checked</if>>
									<label>复式</label>
								</div><div class="checkBoxItem dpflxr">
									<input type="checkbox" name="selling_point[]" value="品牌地产" <if condition="$j neq ''">checked</if>>
									<label>品牌地产</label>
								</div>
								
							</div>
							
						
							
					</div>
					<div class="contentItem upload2 dpflxrw">
						<label for="" class="title">封面图：</label>
						<div class="image pos_rel im" id="cc">
							<if condition="$info['img'] neq ''"><img src="{$info['img_src']}"></if>
							<div class=" pos_abs"></div>
							<label for="" class="suggestion pos_abs">建议尺寸 690px*320px</label>
							
						</div>
						<input name="img" value="{$info['img']}">
					</div>
					<div class="contentItem upload3 dpflxrw">
						<label for="" class="title">banner图：</label>
						<div class="dpflxr imageWrapper">
							<div class="image pos_rel im1" id="cc1">
								<if condition="$imgs[0] neq ''"><img src="{$info['imgg_src'][0]}"></if>
								<div class=" pos_abs"></div>
								<label for="" class="suggestion pos_abs">建议尺寸 750px*480px</label>
							</div>
							<div class="image pos_rel im2" id="cc2">
								<if condition="$imgs[1] neq ''"><img src="{$info['imgg_src'][1]}"></if>
								<div class=" pos_abs"></div>
								<label for="" class="suggestion pos_abs">建议尺寸 750px*480px</label>
							</div>
							<div class="image pos_rel im3" id="cc3">
								<if condition="$imgs[2] neq ''"><img src="{$info['imgg_src'][2]}"></if>
								<div class=" pos_abs"></div>
								<label for="" class="suggestion pos_abs">建议尺寸 750px*480px</label>
							</div>
						</div>
						<input type="hidden" name="imgs1" value="{$imgs[0]}">
						<input type="hidden" name="imgs2" value="{$imgs[1]}">
						<input type="hidden" name="imgs3" value="{$imgs[2]}">
					</div>
					<div class="contentItem upload2 dpflxrw">
						<label for="" class="title">项目海报：</label>
						<div class="image pos_rel im4"  id="cc4">
							<if condition="$info['project_poster'] neq ''"><img src="{$info['project_poster_src']}"></if>
							<div class=" pos_abs"></div>
							<label for="" class="suggestion pos_abs">建议尺寸 750px*1624px</label>
						</div>
					</div>
					<div class="contentItem upload4 dpflxr pos_rel">
						<label for="" class="title">视频：</label>
						<div class="pos_rel">
							<input type="text" class="inputBox" id="up" value="{$info['video']}" readonly="true" placeholder="选填" style="padding-right: 56px;"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;"/>
							<label class="uploadBtn pos_abs " id="upload">上传</label>
							<input type="hidden" name="video" value="{$info['video']}">
						</div>
						<input type="hidden" name="project_poster" value="{$info['project_poster']}">
					</div>
					<div class="ciBtnWrapper">
						<div class="ciBtn" id="bc"><label>保存</label></div>
					</div>
					
				
				</div>



				<!-- 3.1.2.2 户型管理-->
				<div class="switchPage tabPage  card caTable">
						<table border="0" width="100%">
								<tbody>
									<tr>
										<th scope="col" width="9%" style="border-top-left-radius: 6px;">编号</th>
										<th scope="col" width="15%">封面图</th>
										<th scope="col" width="15%">户型名称</th>
										<th scope="col" width="15%">所属楼盘</th>
										<th scope="col" width="15%">面积</th>
										<th scope="col" width="15%">参考价</th>
									
										
										
										<th scope="col" width="15%" style="border-top-right-radius: 6px;box-sizing: border-box;" >户型配置</th>
									</tr>
									<volist name="type_list" id="item">
										<tr>
											<td>{$item['id']}</td>
											<td>
												<div class="image">
													<img src="{$item['house_img']}" >
												</div>
											</td>
											<td >{$item['name']}</td>
											<td>{$item['floor_name']}</td>										
											<td>{$item['house_area']}m²</td>
											<td>{$item['price']}万元/套</td>																																						
											<td style="box-sizing: border-box;" >{$item['house_config']}</td>
										</tr>	
									</volist>
								</tbody>
						</table>
				</div>
				
				<!-- 3.1.2.2 沙盘展示-->
				<div class="switchPage tabPage  caTable">
					<div class="card" style="padding:50px">
						<div class="contentItem upload2 dpflxrw">
							<label for="" class="title">封面图：</label>
							<div class="image pos_rel im5" id="cc5">
								<if condition="$info['sand_img'] neq ''"><img src="{$info['sand_img_src']}"></if>
								<div class=" pos_abs"></div>
								<label for="" class="suggestion pos_abs">建议尺寸 690px*320px</label>
								
							</div>
						</div>
						<input type="hidden" name="sand_img" value="{$info['sand_img']}">
						<div class="ciBtn" id="bc1"><label>保存</label></div>
					</div>
					
					
					<div class="caTable card">
						<table border="0" width="100%">
								<tbody>
									<tr>
										<th scope="col" width="8%" style="border-top-left-radius: 6px;">ID</th>
										<th scope="col" width="17%">楼栋名称</th>
										<th scope="col" width="17%">所属楼盘</th>
										<th scope="col" width="10%">单元数</th>
										<th scope="col" width="10%">房间数</th>
										<th scope="col" width="10%">电梯数</th>
										<th scope="col" width="10%">楼层数</th>																				
										<th scope="col" width="17%" style="border-top-right-radius: 6px;box-sizing: border-box;" >在售房源</th>
									</tr>
									<volist name="build_list" id="item">
										<tr>
											<td>{$item['id']}</td>
											<td>{$item['building_name']}号栋</td>
											<td>{$item['floor_name']}</td>
											<td >{$item['unit_number']}</td>
											<td>{$item['count_fy']}</td>
											<td>{$item['elevator']}</td>
											
											
											<td>{$item['layer']}层</td>
											
											<td style="box-sizing: border-box;" >{$item['count_zs']}套</td>
										</tr>	
									</volist>
								</tbody>
						</table>
					</div>
					
				
				</div>
				
				<!-- 3.1.2.2 周围配套-->
				<div class="switchPage tabPage  card">
				<div class="ctb-box" style="width:calc(75% - 60px);">
					{:hook('BaiduMap',array('name'=>"map",'value'=>$info['map']))}
				</div>
				<div class="ciBtn" id="bc3" style="margin-top: 15px;"><label>保存</label></div>
				</div>
					
				<!-- 3.1.2.2 活动关联-->
				<div class="switchPage tabPageF  card">
					<div class="contentItem  dpflxr">
						<label for="" class="title">关联活动：</label>
						
						<select name="" id="" class="selectBox">
							<option value="">请选择</option>
							<option value="">请选择</option>
						</select>
					</div>
					
					<div class="contentItem  dpflxr">
						<label for="" class="title">佣金设置：</label>
						<input type="text" class="inputBox" placeholder="请输入"
							placeholder-style="font-size:16px;line-height:48px;color:#bfa;" />
					</div>
					<div class="contentItem  dpflxr ">
						<label for="" class="title">围观人数：</label>
						<div class="pos_rel">
							<input type="text" class="inputBox" placeholder="请输入" style="padding-right: 56px;"
								placeholder-style="font-size:16px;line-height:48px;color:#bfa;"/>
							<label class="pos_abs unit">人</label>
						</div>
						
					</div>
					<div class="dpflxrw">
						<div class="ciBtn" id="bc2"><label>保存</label></div>
					</div>
					
				
				</div>
				

				<input type="hidden" id="floor_id" value="{$info['id']}">

			</div>

		<script src="__PUBLIC__/Home/js/tabClick2.js" type="text/javascript" charset="utf-8"></script>
	</body>
</html>
<script type="text/javascript">
	$("body").on('click','#cc',function(){
	// alert('123');
    var thisObj = $(this);
    var inputFile = document.createElement("input");
    inputFile.type = "file";
    inputFile.name = "file[]";
    inputFile.multiple = "multiple";
    inputFile.accept = "image/jpeg,image/jpg,image/png";
    inputFile.click();
    $(inputFile).change(function(){
        var files = inputFile.files;
        for(var i=0;i<files.length;i++){
            uploadImg(files[i],thisObj);
        }
    });
});
function uploadImg(file,thisObj){
    var formData = new FormData();
    formData.append('image', file);
    $.ajax({
        url: "{:U('Mechanism/uploadImg')}",
        type: "post",
        data: formData,
        dataType:"json",
        contentType: false,
        processData: false,
        mimeType: "multipart/form-data",
        success: function (data) {
            if(data.code == 0){
            　　console.log(data.info.imgid);
                var imgid=data.info.imgid;
            	$("input[name='img']").val(imgid);
            	var img=data.info.imgurl;
            	$('.im').html('<img src="'+img+'"/>');

　　　　　　　}
        },
    });
}

$("body").on('click','#cc1',function(){
    var thisObj = $(this);
    var inputFile = document.createElement("input");
    inputFile.type = "file";
    inputFile.name = "file[]";
    inputFile.multiple = "multiple";
    inputFile.accept = "image/jpeg,image/jpg,image/png";
    inputFile.click();
    $(inputFile).change(function(){
        var files = inputFile.files;
        for(var i=0;i<files.length;i++){
            uploadImg1(files[i],thisObj);
        }
    });
});
function uploadImg1(file,thisObj){
    var formData = new FormData();
    formData.append('image', file);
    $.ajax({
        url: "{:U('Mechanism/uploadImg')}",
        type: "post",
        data: formData,
        dataType:"json",
        contentType: false,
        processData: false,
        mimeType: "multipart/form-data",
        success: function (data) {
            if(data.code == 0){
            　　console.log(data.info.imgid);
                var imgid=data.info.imgid;
            	$("input[name='imgs1']").val(imgid);
            	var img=data.info.imgurl;
            	$('.im1').html('<img src="'+img+'"/>');

　　　　　　　}
        },
    });
}


$("body").on('click','#cc2',function(){
    var thisObj = $(this);
    var inputFile = document.createElement("input");
    inputFile.type = "file";
    inputFile.name = "file[]";
    inputFile.multiple = "multiple";
    inputFile.accept = "image/jpeg,image/jpg,image/png";
    inputFile.click();
    $(inputFile).change(function(){
        var files = inputFile.files;
        for(var i=0;i<files.length;i++){
            uploadImg2(files[i],thisObj);
        }
    });
});
function uploadImg2(file,thisObj){
    var formData = new FormData();
    formData.append('image', file);
    $.ajax({
        url: "{:U('Mechanism/uploadImg')}",
        type: "post",
        data: formData,
        dataType:"json",
        contentType: false,
        processData: false,
        mimeType: "multipart/form-data",
        success: function (data) {
            if(data.code == 0){
            　　console.log(data.info.imgid);
                var imgid=data.info.imgid;
            	$("input[name='imgs2']").val(imgid);
            	var img=data.info.imgurl;
            	$('.im2').html('<img src="'+img+'"/>');

　　　　　　　}
        },
    });
}


$("body").on('click','#cc3',function(){
    var thisObj = $(this);
    var inputFile = document.createElement("input");
    inputFile.type = "file";
    inputFile.name = "file[]";
    inputFile.multiple = "multiple";
    inputFile.accept = "image/jpeg,image/jpg,image/png";
    inputFile.click();
    $(inputFile).change(function(){
        var files = inputFile.files;
        for(var i=0;i<files.length;i++){
            uploadImg3(files[i],thisObj);
        }
    });
});
function uploadImg3(file,thisObj){
    var formData = new FormData();
    formData.append('image', file);
    $.ajax({
        url: "{:U('Mechanism/uploadImg')}",
        type: "post",
        data: formData,
        dataType:"json",
        contentType: false,
        processData: false,
        mimeType: "multipart/form-data",
        success: function (data) {
            if(data.code == 0){
            　　console.log(data.info.imgid);
                var imgid=data.info.imgid;
            	$("input[name='imgs3']").val(imgid);
            	var img=data.info.imgurl;
            	$('.im3').html('<img src="'+img+'"/>');

　　　　　　　}
        },
    });
}
$("body").on('click','#cc4',function(){
    var thisObj = $(this);
    var inputFile = document.createElement("input");
    inputFile.type = "file";
    inputFile.name = "file[]";
    inputFile.multiple = "multiple";
    inputFile.accept = "image/jpeg,image/jpg,image/png";
    inputFile.click();
    $(inputFile).change(function(){
        var files = inputFile.files;
        for(var i=0;i<files.length;i++){
            uploadImg4(files[i],thisObj);
        }
    });
});
function uploadImg4(file,thisObj){
    var formData = new FormData();
    formData.append('image', file);
    $.ajax({
        url: "{:U('Mechanism/uploadImg')}",
        type: "post",
        data: formData,
        dataType:"json",
        contentType: false,
        processData: false,
        mimeType: "multipart/form-data",
        success: function (data) {
        	console.log(data);
            if(data.code == 0){
            　　console.log(data.info.imgid);
                var imgid=data.info.imgid;
            	$("input[name='project_poster']").val(imgid);
            	var img=data.info.imgurl;
            	$('.im4').html('<img src="'+img+'"/>');

　　　　　　　}
        },
    });
}



$("body").on('click','#upload',function(){
    var thisObj = $(this);
    var inputFile = document.createElement("input");
    inputFile.type = "file";
    inputFile.name = "file[]";
    inputFile.multiple = "multiple";
    inputFile.accept = ".mp4";
    inputFile.click();
    $(inputFile).change(function(){
        var files = inputFile.files;
        for(var i=0;i<files.length;i++){
            uploadImg5(files[i],thisObj);
        }
    });
});
function uploadImg5(file,thisObj){
    var formData = new FormData();
    formData.append('image', file);
    $.ajax({
        url: "{:U('Mechanism/uploadImg')}",
        type: "post",
        data: formData,
        dataType:"json",
        contentType: false,
        processData: false,
        mimeType: "multipart/form-data",
        success: function (data) {
            if(data.code == 0){
            　　console.log(data.info.imgid);
                var imgid=data.info.imgid;
            	$("input[name='video']").val(imgid);
            	var name=data.info.name;
            	$("#up").val(name);
            	var img=data.info.imgurl;
            	// $('.im4').html('<img src="'+img+'"/>');

　　　　　　　}
        },
    });
}





$("body").on('click','#bc',function(){
	var menu=1;
	var floor_id=$("#floor_id").val();
	var name=$("input[name='name']").val();
	var hot_line=$("input[name='hot_line']").val();
	var min_area=$("input[name='min_area']").val();
	var max_area=$("input[name='max_area']").val();
	var status=$("#status").val();
	var price=$("input[name='price']").val();
	var checked=[];
	$('input:checkbox:checked').each(function(){
		var b=$(this).val() ;
		checked.push($(this).val());
	})
	
	var img=$("input[name='img']").val();
	var imgs1=$("input[name='imgs1']").val();
	var imgs2=$("input[name='imgs2']").val();
	var imgs3=$("input[name='imgs3']").val();
	var project_poster=$("input[name='project_poster']").val();
	var video=$("input[name='video']").val();
	$.ajax({
		url:"{:U('Mechanism/floor_edit')}",
		data:{name:name,hot_line:hot_line,min_area:min_area,max_area:max_area,status:status,price:price,checked:checked,img:img,imgs1:imgs1,imgs2:imgs2,imgs3:imgs3,project_poster:project_poster,video:video,menu:menu,floor_id:floor_id},
		type:"POST",
		dataType:"JSON",
		success:function(data){
			alert(data.msg);
			
		},
	})
})



$("body").on('click','#cc5',function(){
    var thisObj = $(this);
    var inputFile = document.createElement("input");
    inputFile.type = "file";
    inputFile.name = "file[]";
    inputFile.multiple = "multiple";
    inputFile.accept = "image/jpeg,image/jpg,image/png";
    inputFile.click();
    $(inputFile).change(function(){
        var files = inputFile.files;
        for(var i=0;i<files.length;i++){
            uploadImg6(files[i],thisObj);
        }
    });
});
function uploadImg6(file,thisObj){
    var formData = new FormData();
    formData.append('image', file);
    $.ajax({
        url: "{:U('Mechanism/uploadImg')}",
        type: "post",
        data: formData,
        dataType:"json",
        contentType: false,
        processData: false,
        mimeType: "multipart/form-data",
        success: function (data) {
        	console.log(data);
            if(data.code == 0){
            　　console.log(data.info.imgid);
                var imgid=data.info.imgid;
            	$("input[name='sand_img']").val(imgid);
            	var img=data.info.imgurl;
            	$('.im5').html('<img src="'+img+'"/>');

　　　　　　　}
        },
    });
}



//保存沙盘展示
$("body").on('click','#bc1',function(){
	var menu=2;

	var floor_id=$("#floor_id").val();
	if(!floor_id){
		alert('请先保存基本信息');return false;
	}
	var sand_img=$("input[name='sand_img']").val();
	$.ajax({
		url:"{:U('Mechanism/floor_edit')}",
		data:{floor_id:floor_id,sand_img:sand_img,menu:menu},
		type:'POST',
		dataType:'JSON',
		success:function(data){
			alert(data.msg);
		},
	})
})
//保存活动关联
$("body").on('click','#bc2',function(){
	var menu=3;

	var floor_id=$("#floor_id").val();
	if(!floor_id){
		alert('请先保存基本信息');return false;
	}
	var video=$("input[name='video']").val();
	$.ajax({
		url:"{:U('Mechanism/floor_edit')}",
		data:{menu:menu,floor_id:floor_id},
		type:'POST',
		dataType:'JSON',
		success:function(data){
			alert(data.msg);
		},
	})
})
//保存周围配套
$("body").on('click','#bc3',function(){
	var menu=4;

	var floor_id=$("#floor_id").val();
	if(!floor_id){
		alert('请先保存基本信息');return false;
	}
	var map=$("input[name='map']").val();
	// console.log(map);return false;
	$.ajax({
		url:"{:U('Mechanism/floor_edit')}",
		data:{menu:menu,map:map,floor_id:floor_id},
		type:'POST',
		dataType:'JSON',
		success:function(data){
			alert(data.msg);
		},
	})
})
</script>